#! /bin/sh

name=icu
version=77.1
revision=1
tarball_url="https://github.com/unicode-org/icu/releases/download/release-77-1/icu4c-77_1-src.tgz"
tarball_blake2b="7ee4457dbb9abfee543aa91314e052282fb1c73e5fd9d9b21777d2ea32ae29c3eb3d83a78aafc7d00530435c014aa0f6196faf82ed67593c844e28395ab4720e"
source_imagedeps="build-essential pkg-config"
hostdeps="gcc pkg-config"
deps="core-libs"

prepare() {
    autotools_recursive_regen
    cp source/config/{mh-linux,mh-unknown}

    mkdir -p cross-build
    cd cross-build

    ${source_dir}/source/configure \
        CFLAGS="$HOST_CFLAGS" \
        CXXFLAGS="$HOST_CXXFLAGS" \
        LDFLAGS="$HOST_LDFLAGS" \
        --prefix=/usr/local

    make -j${parallelism}
    cd ..
}

configure() {
        configure_script_path=${source_dir}/source/configure \
    autotools_configure \
        --with-cross-build=${source_dir}/cross-build
}

build() {
    make -j${parallelism}
}

package() {
    DESTDIR="${dest_dir}" make install

    post_package_strip
}
